<?php

include './php-ofc-library/open-flash-chart.php';
		$link= mysql_connect("localhost","root","")or die ('Error connecting to mysql');
		$sdb=mysql_select_db("asodeco");
		$query="SELECT factor.enunciado AS fact FROM factor WHERE factor.id= '".$_GET["tit"]."';";
		$result=mysql_query($query ,$link);
		$row=mysql_fetch_array($result);
		$tit=$row['fact'];

$title = new title( $tit );

$pie = new pie();
$pie->set_alpha(0.6);
$pie->set_start_angle( 35 );
$pie->add_animation( new pie_bounce(20) );
$pie->set_tooltip( '#val# de #total#<br>#percent# de 100%' );
$pie->set_colours( array('#3FC030','#800000', '#DBE001') );
$pie->set_values( array(new pie_value((int)$_GET['pos'], "Positivo ".$_GET['pos']), new pie_value((int)$_GET['neg'], "Negativo ".$_GET['neg']),new pie_value((int)$_GET['mneg'], "Muy Negativo ".$_GET['mneg']) ) );

$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $pie );

$chart->x_axis = null;

echo $chart->toPrettyString();

?>